<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:composition template="/WEB-INF/templates/template_interno.xhtml">
	
		<ui:define name="conteudo">
		
			<div class="row">
	          <!-- Page Header -->
	          <div class="col-lg-12">
	              <h1 class="page-header">Lista de Alunos</h1>
	          </div>
	          <!--End Page Header -->
     		</div>
		
		
			<h:form>
				
				<div class="row">
                	<div class="col-lg-12">
                	
							<div class="panel panel-primary">
								 	<div class="panel-body">
			                            <div class="row">
			                                <div class="col-lg-12">
			                                	<div class="table-responsive">
				                                	<h:dataTable value="#{alunoBean.alunos}" var="aluno"  styleClass="table table-bordered table-hover table-striped" >
				                                		
				                                		
				                                		<h:column>
															<f:facet name="header">
																<h:outputText value="Matrícula"/>
															</f:facet>
															<h:outputText value="#{aluno.matricula.numMatricula}"/>
														</h:column>
														
				                                		<h:column>
															<f:facet name="header">
																<h:outputText value="Nome"/>
															</f:facet>
															<h:outputText value="#{aluno.pessoa.nome}"/>
														</h:column>
				                                		
				                                		<h:column>
															<f:facet name="header">
																<h:outputText value="Turma"/>
															</f:facet>
															<h:outputText value="#{aluno.turma.descricao}"/>
														</h:column>
														
														<h:column>
															<f:facet name="header">
																<h:outputText value="Telefone 1"/>
															</f:facet>
															<h:outputText value="#{aluno.pessoa.telefone1}"/>
														</h:column>
														
														<h:column>
															<f:facet name="header">
																<h:outputText value="Telefone 2"/>
															</f:facet>
															<h:outputText value="#{aluno.pessoa.telefone2}"/>
														</h:column>
														
														
														<h:column>
															<f:facet name="header">
																<h:outputText value=" "/>
															</f:facet>
														
															<h:link outcome="editarAluno" value="Editar"  styleClass="btn btn-primary btn-sm">
																<f:param name="id" value="#{aluno.id}" />
															</h:link>
					
														</h:column>
														
				                                	</h:dataTable>
			                                	</div>
			                              </div>
			                     	</div>
			                     </div>
							</div>			
                	</div>
               	</div>
			</h:form>
		
		</ui:define>
		
	</ui:composition>
</html>